package demo0428;

import com.Mouse;
import com.USB;
import demo0428.Keyboard;

class Laptop {
    public void run() {
        System.out.println("笔记本正在运行");
    }
    public void shutdown() {
        System.out.println("笔记本正在关机");
    }
    public void useUSB(USB usb) {
        usb.open();
        if (usb instanceof Mouse) {
            ((Mouse) usb).click();
        } else if (usb instanceof Keyboard) {
            ((Keyboard) usb).敲击();
        }
        usb.close();
    }
}